package cn.njxzc.examples;

class S {
	void print() {
		System.out.println("class S");
	}
}

class R extends S {
	void print() {
		System.out.println("class R");
	}
}

class C20 extends S {
	void print() {
		System.out.println("class C");
	}
}

class T extends S {
	void print() {
		System.out.println("class T");
	}
}

class Exam3_20 {
	static void method1(S s) {
		s.print();
	}

	public static void main(String[] args) {
		R r = new R();
		C20 c = new C20();
		T t = new T();
		method1(r);
		method1(c);
		method1(t);
	}
}
